enhance sorting of contents

Should've been added on PR #5