ADD: grid data structure and related unit tests