Added Functions for Assignment 2