add a fun to count score