solve problem #21