end of ch.4: functions