finished implementation of principal component analysis from the book.