protected static int HeightOf(IList<RectangularStep> upstream)
{
if (upstream == null || upstream.Count == 0) throw new ArgumentException();
int height = upstream[0].Height;
if (!upstream.All(step => step.Height == height)) throw new ArgumentException();
return height;
}