initial clustering; cleanup