finished accuracy checking function