I would like to know about the frame from friends series algorithm

I have some bugs I am trying to fix from this algorithm, and I am not sure where to start. Can anyone in this forum help me out with what I would need to know to successfully fix the bugs and get this algorithm working for me?
