Ok seriously. Bad entry count is working, fixed some bugs that caused incorrect user id calculation. script can also run on only new data now, without wiping all of the old data.