second version of the score calculation taking into account edge cases