Added single for loop, with nested conditional inside.