Fix syntax errors

Fixed few syntax errors and imports.

- Typo in shebang
- Imported sys library
- Perimiter > Perimeter
- fixed get_distances to return distances
- fixed get_distance
- Replaced file_name var to path to prevent shadow declarations