added a whole bunch of QgsDebugMsg for better understanding