bug fixed, however loop logic while correct, needs rewrite for simplicit...

...y