Finish exercise 1.23, modify 1.22 for comparation

For exercise 1.22, when using import, its speed it much faster.