Rewrote all of it so its less clunky