Added documentation blocks to all functions