preparing code samples for ch1