added state switching, not working currently.
truncated normal attempts