making accuracy algorithm