boundary: reimplementation