Fix bug with too few neighbours. Add arguments for grid size.