Fixed documentation and removed unused code