added test code to test max