moved grid construction/display to its own file