HUGE changes. Should have commited much sooner.