Unity origin of tilting

I am creating a 3D iphone game where the player navigates obstacles by tilting of the device and moving in a 2D plane, the X and Y. I have gotten the tilting acceleration to work, however, it only works if my iphone is completely horizontal, otherwise it goes off to the side because it is checking the acceleration from that point. How can I make it so that whatever position the iphone is in right before I check the acceleration, it will use that point instead of the one with it being completely horizontal. If I have not explained this well enough I can try again. Here is my code for the acceleration:

dir.x = Input.acceleration.x;
dir.y = Input.acceleration.y;
transform.position = new Vector3(transform.position.x + dir.x, transform.position.y + dir.y, -24);

Thanks again.

I was actually able to solve this problem, by creating a new Vector named startPosition, I simply gathered the Input.acceleration.x and Input.acceleration.y when I desired that to be the new orientation, and then added the new accelerations to it, allowing it to check acceleration against that first Vector.

if(!foundOrientation)
{
	startVector.x = Input.acceleration.x;
	startVector.y = Input.acceleration.y;
	foundOrientation = true;
}
dir.x = startVector.x + Input.acceleration.x;
dir.y = startVector.y - Input.acceleration.y;
transform.position = new Vector3(transform.position.x + dir.x, transform.position.y + dir.y, -24);