finish the function checkerboard and its example