Implemented score calculation