alternative version of checkerboard function