example solution  from, Murray paton