Pull the creation of the "RewindFunction" function out of the loop. It's only