added error handling
renamed matrix#inverse -> matrix#invert