changed movement prediction routines, refactored