Nearly finished localDB functionality