Exercise #4 for CSci 211.