moved function kernel return to inputs