main loop changes