fix domain boundary indexing
the compiler pointed out that boundary[2][2] doesn't exist. If I understand this correctly, those checks should be against boundary[*][0].