Ignore measurements in case velocity is -1 or traveltime is 0.
Refactored some code
Bug in Main fixed, try again in case of an error