adding generalized li function for Lillian