new version and demo code