added functions as per the programming assignment instructions