#7 - refactored sorting to a scope