Cleaned up code
Added interpolation function, centdiff option in avg