Improved sorted equation, not using itemgetter anymore, one less module