Size estimate algorithm