Removed unused items and added comments
Added some documentation
Removed unused