reduced mkdir code; while loop replaced by cron job