Updated all documentation, fixed function defs