added doc blocks to functions