updated for rank in boundary