Some improvements on the Damerau script