added grid averaging and shape limit