Homework #6 for CSCI322