public void updateTo(int index) {
        if (index >= 0 && index < chain.size()) {
            if (currentIndex > index) {
                //Go back
                for (int i = currentIndex; i > index; i--) {
                    chain.get(i).revert();
                }
            } else if (currentIndex < index) {
                //Go forwards
                for (int i = currentIndex + 1; i <= index; i++) {
                    chain.get(i).restore();
                }
            }
            currentIndex = index;
            notifyOfUpdate();
        }
    }