adding problem 12 solving