Update cachematrix.R

This is my updated work. On my machine it seemed to be working =)