encode depth into results (work in progress)