Changed sequence to HashSet

Changed sequence parameter type from List to HashSet and I got HUGE
performance boost. The problem was in List.IndexOf that was O(n) and now
HashSet.Contains is O(1)