completed second problem