Added compare kernel function