Please make all the variable in this function local.