Programming Assignment 2 mods for matrix inversion