fixed 0 values of precission and recall and enhanced code readability