complete loot function

complete the loot function.