bug fixing and preparing the ground for the simulation section