Added functions and test cases to Part D - assignment 1 finished