define function by var