addid init, removed cruft, refactored database