First cut at my homework for Programming Assignment 2.

I have written the functions based on the example and have tested a
simple 2x2 case.