utility modules for motion correction