created main autonomous loop