attempting to resolve sorting bug