Update function

Write your own updatefunction