Fixed up test code for Layer1 and added debug prints
Merging Weilong's DBlk code for Layer 1
Changed debug flag to be integer