implemented base glubtok script, needs testing!