Functions for the 2nd Assingment