Sorting fragments

Switching to adding instead of replacing, and refactored names.