Optimize local marker loop

Replace unconditional 'for loop' with conditional 'while loop', script exits when it's job is done now.
Merge pull request #3 from CaseMonster/patch-1

Optimize local marker loop