switched to subprocess instead of os for terminal commands