removed dead code. added documentation