Moved prediction to it’s own function.