Implemented total score calculation