clean implementation of dualG