minor changes in the structure of the code