fix some minor bugs
add some linear interpolation