rand kernel method fix