Single vars

switched code to use one var per statement. fixed a handful of small linting errors. found and fixed a weird bug in mapreduce.