exercises and reference code