finished problem 11 with a diags function