solve problem #12