make the script work mostly