Extracted frame_making. Preallocating frames array for speed.