Rewrote code to be more efficient

no longer copying essentials