add a predict function