starts building score algorithm and function