added offset functionality