modified version for GRT program