Add interpolation, reorganize code.