pie demo code