Adapted the demo to API changes, so it can be run again
Added simple demo for testing period adaptation.