Edited two functions for Assignment 2