expanded functionality of map() to include deep iteration