Assignment2 Functions