_ functions for map and reduce