replaced stripComments method by non-regex version