create a new line and delete useless lines