Completed fjw -> implement map with reduce