problem nine
additional solution for problem 8