Moved the main function to a separate file