Added dynamic grid sample