port tutorial from dpj (section up to 2.4.).