error-free cluster.cpp