changed .sort() to sorted()