first version of tf with kernel functions