clean code organisation
added some comments and cleaned the code