Assignment 4: functions