updated gcap function