added grid saving