finished refactoring kml output file