added inference stuff