Implement motion detection in MIPS