Set up logic that undo will need