Updated to sort correctly