Add predict function