Add documentation of functions
Check more errors