inter prediction - 1st debugged version