Edited with a different sort function