implement kernel method