added whileloop in the main class
fixed merge conflict