added test cases. some minor formatting