code with demo