almost done, main function for testing