add function for computing scores