cleaned up clustering