add solution to problem 9, flattening a list