mistakes in links counting method fixed