programmed allocate_resources() and deallocate_resources()