buffer variables to global variables