minimising overall lines changed