private SlotIndex GetMaximum(SlotIndex a, SlotIndex b, SlotIndex c, SlotIndex d)
{
var max = a;
if (max == null || (b != null && b > max))
max = b;
if (max == null || (c != null && c > max))
max = c;
if (max == null || (d != null && d > max))
max = d;
return max;
}