update the 3rd solution