documentation and remove some commented code