Improved documentation.
Removed unused variables.