improve get inverse direction