Improved formatting, flattened a conditional and updated to new interpolation method