added zad3 (map reduce)