Understanding the mechanism of the Povarov reaction. A DFT study