Add new code from Puzan