reimplementing depth map (distance function)