Completed section 9 - functions