added translation support, better state transitions