So you don't need to take the first 3 digits, you need to remove the last 4 digits. The logic behind this is that I create directories with at most 10,000 files.
I checked for a few userIDs too, those seem to work fine.
You did almost everything for me

Made a small code change, now it is working.
delete this
var topfolder = top.slice(0, 3);
and add this:
var topfolder = top.substring(0, top.length-4);
Or just download it here:
https://bitcoindata.science/LoyceV/LOYCE.htmlI made about 10 tests, looks fine.