Remove dead code, add comments