Implemented map using exists
Added test case for map