updated script. this is incredibly frustrating