added predict function