Cleanup, added main program loop