Splitted regex -- is more readable.
Get rid off recurssion.
Removed unused var, added docstring