solution to p08.ml