Got rid of defining frames = frames.pop