added a while loop in main method