Modified comments to be more legible. Fixed mis-spelling of setinverse() function in line 53 - the function call would probably still have worked due to R's ability to use partial names, however it wasn't done on purpose, and even if it was i believe it to be a bad habit to rely on.