added some additional regular expressions, defined functions