Restructured class

Added calcDistance method and corrected syntax