First pass at test looping, still needs some work