unicorn main loop