Sort references closes #15