Did some database related stuff... it isn't right but it'll do for now.