Added persistence

Can now persist to the database