Hw: generate a grid