Fixed error.
Added documentation.