added Gdc method (untested)