Refactored the spaghetti for forwards warping into "forwards.m"