new implementation in demo