validating grid size input. fixes #3.