Reworked to cut iterations down with "prime" info