added support for ions, and a test