adding motion shifting in processFrames