WIP: begin implementing distance matrix