Significantly improved score algorithm