Updated demo function