support code for the demo