improved white space matching