patternized the score to save memory, optimized code a little