working on rewrite of motioncor