database saving and syncing (with some sync bugs still)
merge