Changes to make runnable. Not good enough to bother making better