add variable d in func main