add code to save linear clustering results