added score calculation