Making the example a bit more robust

I added a few functions to save lines and also included the trackPoints variable.