added test cases and map functionality