Added a main function.