added plotting feature to clustering function