Code now looks at set folder and has the new attributes
Some minor fixes and refactoring