Nearly complete first and sencond chapter's exercise.

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