fixed bug with wildpoint at the begining, now searching for a valid pair in the buffer