working version, need clean database