Adapted getFrames to work with new data structures.