Added documentation

Added documentation to functions