Add local copy of clustering function
Revise/clean up Jeff's slides