added offset parameter to window