added prelim motion algorithm, run with -a flag