Deleted a lot of useless stuff. Parameterized size of grid.