inprovement of score function