added movement prediction. many other changes