code optimisation - stuck.

Osgeld,

Alas you lost me.

As much as I can sort of see what you mean, it is more the looping/calling which has me stumped.