Add function doc blocks & fix syntax