* refactor * phew * drive-by fix * all done I think * cleaned up some lines that didn't do anything, added more comments, removed log spam