Modified gen_cropus function
Added new function gen_cluster