started implementing clustering algorithm