Modified animation function to keep track of rendered frames.
Modified frame_print to set filenames correctly.