[US-6] Implement sorting