analysis.r: added 'debug' code