simple tiny map reduce implementaion