Fixed bugs, re-wrote methods, O(n + m) guaranteed