Solution to diamond problem.