Added a skeleton main loop