include code cut from write.js
cut code
change the sort of js