this should be `if (typeof xoffset === "undefined") {