main loop working