Some necessary libraries
solved merge conflicts
Reimplemented getDistance
Solved merge conflicts