Added functional "while loop".