updated the explanation on the solution