adapted script
modified script