smoothed out ion algorithm/bugfixes