detection of direction
autocompute