offset is a global var