Assignment 4: Functions Solution