More fixes prior to final submission

Added some more comments

Addressed issue where cached solution was unnecessarily discarded when
setting new matrix values when the new values matched the old

Added class attribute to allow more descriptive error when passing
invalid objects to solve cache