zad 4.313 - ver1 refactored