Rewrote a few things