Ch 3. Sec 4. Implementing input aligner