improved code about functions of sed.