First implementation of the ambiguity resolution.