simplified the gram-schmidt implementation to be more eigen-ful