Refactor

1. Resolve the bug introduced in previous commit.
2. Add some comments.
3. Move pos initiation of blocks in shape into func initShapeBlock.