got the map function to actually take averaged value