Created the main function