transition to using Vec2D instead of std::pair