back to old algorithm