changed dms2dd code