move q=0.5 to main loop