easy dynamics: use define-event-function