Removed redundant code, added comments
Removed unused files