Rewrote the whole damn thing, everything's awesome now.