change the type of id, parent, distance in case the data is very big. add toString function