Corrected division error in create_topology()