use Sets instead of Lists

@williamboxhall The inputs/outputs shouldn't have duplicated elements and the order is not necessary.