works for valid and invalid input data. generates GPX file