Added first go at creating stateSets. This is a commit to save work, as it still segfaults.: