modified function after taking gams file