Cleaning

Cleaning some code and added comments