small edits to clustering.R