slowed down the main loop to conserve processor