Remove dead code.
Refactor, add comments.
Fix compile error.
Fix bugs.
Minor comment.