modified Gerg code