fixed a bunch of issues with the first pass