Adding saving functionality