The upper loop boundary was wrong as the size of a single chord was taken instead of the whole chord table.