corrected regex pattern & removed useless plotting code
more clean-up