Move monog_cluster function to .cpp