Some changes in score function