Fixed blanks

I'm feeling bad about this code, should have designed it more on paper
first
Refactored very slightly