Added documentation. Made minor changes