add comments.
adding missing module.
cleaning up the code.