reworked the script