Added ability to specify number of eigenvalues to keep.