Eliminate double variables