added pseudocode for the tolerance generation function