attempting to add functionality as per assignment 3