db works but is horribly structured