working optical flow loop for forward. need to thread it !