use install instead of cp, and install -d instead of mkdir -p