Simplify map but still getting memory errors