added flexgramsize