Helper script for clustering