Added code to compute F1 scores