adding basic functionality to undistort code