added minimum grid size constraint