added map implementation via foldr