correction of some mistakes in weighted pred algorithm