Start unraveling and redesigning main loop