added config, added loot_all, cleaned up code