draft version of map-reduce and functional programming