fixed bug in LMscore method