Making the variables inside the epoch functions local