Simplified while loop