Update of the code

Reorganizing it