Converted 'gundo' from function to script.