added a function that returns the current animation frame index