speed up main loop