Trying to implement principal axis