cleaned up demo code