Added solution where the conditional is completely under the for loop.