added capability to direct output to file in shell