Added labels and basic distance function