add range value propagation and clean up some old code