Added variable number of frames for animation.