rewrote desugar for to use hashmap