set up linear interp code