Removed offset var in function