Rewrote some stuff, updated some other stuff.