[Bug fixed]

1. if ref code length < 32 => just use ref
2. bug fixed, block edge is 8 not 6
3. refactor