Try putting print statements (either the word print or a question mark followed by the variable name)after each variable assignment so you can see what the values are.
for example:
funds = tokenValidation()
? funds
If funds is never equal to 1 then it will never exit while.
You also should have a return -1 (need to return something) after the end while. My guess is funds never = 1 here.
- Joel