Added code to collect resources