added a lot of comments and fixed a problem in distanceBetweenPoints with stringed or floated coordinates