fixed Josh's smelly linting errors and fixed the reduce code