added a testing main function