Added detection of the type of the cluster. Removed output of some intermediate results.