Final version with "whacky" for loop.