Found that Python considers two lists different even if the elements are the same if the elements are out of order. Using set instead.