Changed implementation of sets