Got database working