Stack distances calculate.