How can the loop be stopped after one cycle?

ColRay:
I see I will try and add a servo code wish me luck Colin

If you don't have it already then just stop where you are. Going out an grabbing 'a servo code' just adds an unknown to what needs to be totally known before adding anything. If you have 2 bugs, 1 can mask the other and have you fixing code that's not broken.