Use sets and fix indentation