Added single for loop and while loop.