algo now runs 60x faster