Implemented some logic, improved documentation and linting.