finished documentation and fixed typo in variable names