added code for extracting error propagation tree