Invertible matrix functions as per assignment 2