Replaced map with list comprehension. In python 3, map returns an iterator, not a list.