Added predict function