modified jared's script