finish function chapter section 5,6,7

Signed-off-by: xiehuc <xiehuc@gmail.com>