task 4 lab 3 and unit test for it