Added some more functions and cleanup to staypoints file