Assignment3: tasks 3,4 + tests