made map its own function