changes for assignment 2 of coursera course.
matrix inversion using '<<-' and caching