added a main function