Rewrote Most of the stuff.