Updated OnAnimation, code cleanup