faster while loop
minor