fixed things maybe
merged from upstream
Merge pull request #1 from mathphreak/master

reformatting for ease of debugging