Creating a grid. Refining it. Writing it to a file
