Working version of cacheSolve, works for any square matrix, checks for the pressence of NA