Added comments.
Bug fixes.