Updated 'gundo' function.