add transitions
modify loop