Completed algo for finding centers in the set of objects