completed derivation of first principal component