rewrote batch script