A solution of the externality problem using strategic matching