implement precision and recall