Homework 2 submission.  Closely based on makeVector.