changed the endless loop to be slightly less endless