port

porting some of inner workings of parsing stuff