changed from old os interface to subprocess