A method for assigning codes to Huffman trees and repairing invalid Huffman trees is disclosed using a calculated delta and moving nodes within the Huffman tree by adjusting their encode register entries. The invention further provides a related aided design method and a recording medium for recording a program for carrying out the method, wherein the data of parts used in a simulation for paper transportation can be easily exchanged. Based on the ratio of the estimated knock signal during knocking to the estimated noise signal during no knocking, the knock control system determines if an accurate knock signal can be detected. Adjacent strips are then mosaiced together to form a final image of the area of interest. The conventional arrangement of balls in regular rows and columns is replaced by helical rows or random arrays of the balls thus to avoid excessive grooving and deformation of the wall of a receptor into which the connector is inserted.