Adds working do/undo function for tasks