Comments added and loop while(true) changed to do while statment