update code to support the reuse grid