The Glaser reaction mechanism. A DFT study