code added for saving links and accuracy