Better backup algorithm