Better formating, patched a couple of missing ]'s

Also: converted sets to tuples as they're a more appropriate data structure.