added a predict function