better position calculation