Some exercises from Kernigan & Richie