Did some clean up
I should really re-write this from scratch -_-