Refactoring + fixed bug(int score -> double score)