Got database working sortof