implemented done/undone function