Check conditions and comments

Added checks for non invertible matrices and method comments