Rewrote a bunch of shit
Add refs