Updates to code to get it working roughly.