final solution for prob11