Dajung's save and load db functions