Adding documentation
Removing dead code