Remove dead code and start adding documentation comments