merged changes; cleaned up regexes