add function for saving predictions