small changes for solution for problem H