always should consider the boundary