working on gState