Remove trailing whitespace
Simplify while loop