adding predict function