#27 added some improvements about depth maps and distances