Added functionality for testcase 3, lab 2