for (;;) and check when peek() if null was returned