edited functions per assignment instructions