Added comments.
Removed some useless code.