replaced a list comprehension with a map