fixing bug in showG()