EECS587 Programming homework 1