better grid and edit function