Added global offset variable