Moved the compilation of score to the end