optimized speed of score computation