function to calculate accuracy added