add plot and fixed interpolation indexing