modified to handle passed arguments to the map