Updated assignment with a test driver. Changed the name of some variables for consistency.