Added documentation. Removed unnecessary comments.