add bad code for 3 types of ions