simplified and made it more complient to the standard. Now strings are extracted properly (and can contain '{ , [' and alike)