Rewrote using a for loop instead of while loop.

Commented out the while loop part. Am practicing and making sure both are
understood.