add dicument scoring function