add -x and remove some useless lines