Added a main function