Mostly rewrote a ton of stuff.