added pointerOffset and updated pointerPosition