matchNext() method added