Updated cluster code for cross-validation fitting