added helpers for gj elimination