new implementation for the demo