Got the database working