Update to cleaner (if possibly less efficient) code, interpolate values.