adding var function