simplified the script again