fixed regex, dependency problems, working
fixed variable scope