Cleaning up code to work from scratch.