cleaned up code to make it easier to demo.