tweaked demo code
cleanup