More database work

fixed some database shit and made stuff work