Wrote some comments, added keepVals function to compute number of eigenvalues to keep.