fix issue and refine the code
add safety buffersize
refine code
use shiftwindow to refine RC algo.
refine code
fix bug
refine the code
update table