the list.sort method seems to do exactly what you want? Unless your array() method is creating a custom array object with different sort functionality than list? Cheers