task 6 lab 3 and unit test for it