adapted warehouse to same output as tmp and db
need some more work