new version of the code for CMSSW_5_3_11_patch6, modified by Andres Florez