the loops are finally sane. much improvement needed, still