Demonstrating the onUpdate function