updated and tested code

added function equalMatrices to test matrix equality - if matrix passed
to makeCacheMatrix is not equal to cached matrix, recalculate inverse
and cache inverse.