Adding more documentation about functions and fixing some errors in messages doc