adds functions for score calculation