made change to max principle check to use A matrix directly