redo function is now workable