Added function to generate predictions