IE compatible sort function