minor modifications to writing batch files