fixed some issues
cleaned up the code a bit. Still in the process of trying to automate the interpolation.