Fixing score calculation. Adding test.