bug fixe on the main script and adding XML topology file read and write