Basic saving. Fulfills the requirements of Question 3, but not perfect yet.
fix id not outputting.