finish replaceHeaders, and fix sort.
fix test
start replace values function