working version of motion model for leg detection.