Style

I would like to wait to merge this until there are no more issues reported by rubocop.

## Checklist
I've fixed all the other issues, this list only has the remaining ones.
- [ ] don't use global variables
- [ ] avoid long methods
- [ ] avoid giving methods a high cyclomatic complexity

## Rubocop usage
```
gem install rubocop
rubocop
```