changed main loop condition for PEP 8 compliance