added subsampling for manual clustering