grid implementation