Added code from ckandump repository