Assignment2 functions are completed