added offset to state constructor