added Defensive Mapper Code - mapper.py