changed chipGapPix to global var