KatzCWT algorithm