updated to use provided test cases.