convert to dot and back