make the main loop a little less cpu intensive