fix and optimization of update_energy
update_energy function needs to be fixed
protection and deletion of regions does not work
(could be prblem in energy_matrix.ml or carving_marnager.ml)
need to fix/rewrite update_energy