wrapped demo in a main() for data generation