more details on second while loop