inverting position A and k