remove unused variable "offset"