return NSArrays instead of NSSets
update unit tests to use arrays instead of sets
minor formatting updates