Add Kai's code