added the prediction functionality
some errors to fix in both