Moved back the main function