use string::compare instead of substr()==
larger read buffer for performance