Move reverse sorting to sorted function

Remove list.reverse operation and used sorted(reverse=True) instead.

This is a microoptimization :-)