replaced last reduce with map

Innermost reduce call should of course be a map! Thanx @megawac!