copied over transition code