Relative position calculation moved to method