added in functionality to create directories specified in dest if necessary