Adding kernalizing code and comparator