Added comments for the main function