new inference function