Added dynamic grid selection