Improving the answer.

See more info here http://www.cs.nott.ac.uk/~gmh/solutions.pdf