moved peeking functionality to parser, fixed peeking