Assignment 3: tasks 5, 6 with tests