adding in functionality for -d argument