existing code from grid added 2