fixed variable names, still problem with regexs