made main loop