Modified the measurement kernel code