score.rb taken completely from master