Updated function documentation and corrected typos