Added code for single line while statement, debugging and change
variable name