fix errors and update documentation