My code for Homework 2 in EECS481 Winter 2014