Simplification and sorting to not have random order