fixed first-time db init issues. added reformatted classes that didn't get into the last commit