Added sorting for resolution