modified to process large number of nFrames