Lines 43 and 46 contain the same test (`if netX.Contains(first)`); line 46 should probably be `if netX.Contains(last)`, right?