Given code from CS3243

Signed-off-by: Huu Khiem <TongHuuKhiem@gmail.com>