function was updated to save out an animation