took out the userid refs, adding inference function