Clean up the code and added comments
Removed some comments