F score algorithm