Added flags to control animating