algo for resources