Breaking apart the main function