built a saving function w/routes and such