fixed error (in position calculation)