started layer debug grid, needs to be refactored for performance