Code completed up to middle of synchronization section of Ch. 4