added some more output code to compare with NKS code