organizing main
calculate cluster metrics