Implement replacing states