Updated ion.py, still old matlab code in sort.