implemented next rules of demo